<?php
namespace app\common\model;
use x\Xbase;
class Wxmedia extends Xbase
{

  //删除素材
  public function del($path){
    $app =   m('weixin','c')->getApp(c('api.wx_gzh_config.myb'));
    $rs = $this->db->query("select * from wx_media where path=?",[$path],1);
    if($rs){
      unlink($rs['path']);
      $this->db->delete('wx_media', $rs['id']);
      $app->material->delete($rs['media_id']);
    }
    return true;
  }
}
